﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Masterpages/Main.master" AutoEventWireup="true"
    CodeFile="ProjectsDetails.aspx.cs" Inherits="User_Shares_ProjectsDetails" EnableEventValidation="false" %>

<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="asp" %>
<%@ Register Src="../../Controls/ContentHolder/Holder1.ascx" TagName="Holder1" TagPrefix="uc1" %>
<%@ Register Src="../../Controls/SelectContract.ascx" TagName="SelectContract" TagPrefix="uc2" %>
<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <style type="text/css">
        .progress
        {
            z-index: 20;
            vertical-align: middle;
            text-align: center;
            float: right;
        }
    </style>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">
    <%--<uc1:Holder1 ID="Holder11" runat="server" >
    <ContentTemplate>
    
    
    <asp:LoginView ID="LoginViewSearch" runat="server">
        <RoleGroups>
            <asp:RoleGroup Roles="admin,bonyadshahrestan,fourthfactor,employer">
           <ContentTemplate>
           <div class="span-10">
               <asp:CheckBox ID="CheckBoxAdvisor" runat="server" Text="مشاوران"  Checked="true" AutoPostBack="true"/>
               <asp:CheckBox ID="CheckBoxSurveyor" runat="server" Text="نقشه برداران" Checked="true"  AutoPostBack="true"/>
           </div>
           </ContentTemplate>
            </asp:RoleGroup>
            <asp:RoleGroup Roles="Surveyor,advisor">
            </asp:RoleGroup>
        </RoleGroups>

    </asp:LoginView>
    <br />
    <asp:UpdatePanel ID="UpdatePanel1" runat="server" UpdateMode="Always">
        <ContentTemplate>
            <div style="padding: 7px;">
                <div style="width: 250px">
                    <table dir="rtl">
                        <tr>
                            <td align="left" dir="rtl" width="100">
                                <asp:Label ID="Label1" runat="server" Text="شهرستان:"></asp:Label>
                            </td>
                            <td align="right" dir="rtl" width="200">
                                <asp:DropDownList ID="DropDownCity" runat="server" Width="150px">
                                </asp:DropDownList>
                                <asp:CascadingDropDown ID="CascadingDropDownCity" runat="server" TargetControlID="DropDownCity"
                                    Category="City" PromptText="شهرستان را انتخاب نمایید" LoadingText="لطفا کمی صبر کنید"
                                    ServicePath="~/user/shares/DatabaseLocations.asmx" ServiceMethod="GetCity">
                                </asp:CascadingDropDown>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" dir="rtl" width="100">
                                <asp:Label ID="Label2" runat="server" Text="بخش:"></asp:Label>
                            </td>
                            <td align="right" dir="rtl" width="200">
                                <asp:DropDownList ID="DropDownBakhsh" runat="server" Width="150px">
                                </asp:DropDownList>
                                <asp:CascadingDropDown ID="CascadingDropDownBakhsh" runat="server" TargetControlID="DropDownBakhsh"
                                    ParentControlID="DropDownCity" Category="Bakhsh" PromptText="بخش را انتخاب نمایید"
                                    LoadingText="لطفا کمی صبر کنید" ServicePath="~/user/shares/DatabaseLocations.asmx"
                                    ServiceMethod="GetBakhsh">
                                </asp:CascadingDropDown>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" dir="rtl" width="100">
                                <asp:Label ID="Label3" runat="server" Text="دهستان:"></asp:Label>
                            </td>
                            <td align="right" dir="rtl" width="200">
                                <asp:DropDownList ID="DropDownDehestan" runat="server" Width="150px">
                                </asp:DropDownList>
                                <asp:CascadingDropDown ID="CascadingDropDownDehestan" runat="server" TargetControlID="DropDownDehestan"
                                    ParentControlID="DropDownBakhsh" Category="Dehestan" PromptText="دهستان را انتخاب نمایید"
                                    LoadingText="لطفا کمی صبر کنید" ServicePath="~/user/shares/DatabaseLocations.asmx"
                                    ServiceMethod="GetDehestan">
                                </asp:CascadingDropDown>
                            </td>
                        </tr>
                        <tr>
                            <td align="left" dir="rtl" width="100">
                                <asp:Label ID="Label4" runat="server" Text="آبادی:"></asp:Label>
                            </td>
                            <td align="right" dir="rtl" width="200">
                                <asp:DropDownList ID="DropDownVillage" runat="server" Width="150px" OnSelectedIndexChanged="DropDownVillage_SelectedIndexChanged"
                                    AutoPostBack="true">
                                </asp:DropDownList>
                                <asp:CascadingDropDown ID="CascadingDropDownVillage" runat="server" TargetControlID="DropDownVillage"
                                    ParentControlID="DropDownDehestan" Category="Village" PromptText="آبادی را انتخاب نمایید"
                                    LoadingText="لطفا کمی صبر کنید" ServicePath="~/user/shares/DatabaseLocations.asmx"
                                    ServiceMethod="GetVillage">
                                </asp:CascadingDropDown>
                            </td>
                        </tr>
                    </table>
                </div>
                <br />
                <asp:GridView ID="GridViewProjects" runat="server" Width="300px" AutoGenerateColumns="False"
                    EnableModelValidation="True" AllowPaging="True" AllowSorting="True" PageSize="30">
                    <AlternatingRowStyle BackColor="#FFFF99" />
                    <Columns>
                        <asp:BoundField DataField="AdvisorFullName" HeaderText="نام مشاور" />
                        <asp:BoundField DataField="City" HeaderText="نام شهرستان" />
                        <asp:BoundField DataField="Bakhsh" HeaderText="نام بخش" />                        
                        <asp:BoundField DataField="Dehestan" HeaderText="نام دهستان" />
                        <asp:BoundField DataField="VillageName" HeaderText="نام روستا" />
                        <asp:BoundField DataField="ContractDate" HeaderText="تاریخ قرارداد" />
                        <asp:BoundField DataField="ContractNumber" HeaderText="شماره قرارداد" />   
                        <asp:BoundField DataField="ContractTypeText" HeaderText="نوع  قرارداد" />
                        <asp:TemplateField HeaderText="دیرکرد">
                            <ItemTemplate>
                                <asp:Label ID="Label5" runat="server" Text='<%# Eval( "HasDelayText" ) %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Button ID="ButtonSeeMore" runat="server" CommandArgument='<%# Eval( "ContractId" ) %>'
                                    CommandName="ContractId" OnClick="ButtonSeeMore_Click" Text="مشاهده" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="DodgerBlue" ForeColor="#000066" />
                </asp:GridView>
            </div>
        </ContentTemplate>
    </asp:UpdatePanel>
    </ContentTemplate>
    </uc1:Holder1>--%>
    <asp:UpdatePanel ID="UpdatePanel1" runat="server">
    <ContentTemplate>
        <asp:LoginView ID="LoginViewSearch" runat="server">
        <AnonymousTemplate>
                    <uc1:Holder1 ID="HolderSearchByDetails" runat="server" Title="خطا!">
        <ContentTemplate>
        <br />
             ابتدا باید به سیستم وارد شوید.
             <br />
        </ContentTemplate>
        
    </uc1:Holder1>
       
        </AnonymousTemplate>
        <RoleGroups>
        
        <asp:RoleGroup Roles="admin,employer,viewuser,edituser">
        <ContentTemplate>
            <uc1:Holder1 ID="HolderSearchByDetails" runat="server" Title="جستجوی پروژه برای مشاهده جزئیات">
        <ContentTemplate>
            <uc2:SelectContract ID="SelectContract1" runat="server" OnClick="SelectContract_Click" />
        </ContentTemplate>
    </uc1:Holder1>
        </ContentTemplate>        
        </asp:RoleGroup>
        <asp:RoleGroup Roles="Surveyor,advisor,fourthfactor,bonyadshahrestan">
        <ContentTemplate>
         <uc1:Holder1 ID="Holder11" runat="server" Title="دریافت مدارک" >
              <ContentTemplate>             
              
            <div style="margin:auto;" class="cent">
              
                <asp:GridView ID="GridViewProjects" runat="server"  AutoGenerateColumns="False"
                    EnableModelValidation="True" AllowPaging="True" AllowSorting="True" PageSize="10"
                    BackColor="#CCCCFF" OnPreRender="GridViewProjects_PreRender" OnRowDataBound="GridViewProjects_RowDataBound" FooterStyle-BackColor="#3399FF">
                    <AlternatingRowStyle BackColor="#DDD9FF" />
                    <Columns>
                        <asp:BoundField DataField="AdvisorFullName" HeaderText="نام مشاور" />
                        <asp:BoundField DataField="City" HeaderText="نام شهرستان" />
                        <asp:BoundField DataField="Bakhsh" HeaderText="نام بخش" />                        
                        <asp:BoundField DataField="Dehestan" HeaderText="نام دهستان" />
                        <asp:BoundField DataField="VillageName" HeaderText="نام روستا" />
                        <asp:BoundField DataField="ContractDate" HeaderText="تاریخ قرارداد" ItemStyle-Width="100" />
                        <asp:BoundField DataField="ContractNumber" HeaderText="شماره قرارداد" ItemStyle-Font-Bold="true" ItemStyle-ForeColor="Black" />
                        <%--<asp:TemplateField HeaderText="پیشرفت">
                            <ItemTemplate>
                                <asp:Label ID="LabelProgress" runat="server" Text='<%# Eval( "Progress" ) + " %" %>'
                                    Style="clear: both; display: inline;"></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>--%>
                        <asp:BoundField DataField="ContractTypeText" HeaderText="نوع  قرارداد" />
                        <asp:TemplateField HeaderText="دیرکرد">
                            <ItemTemplate>
                                <asp:Label ID="LabelDelay" runat="server" Text='<%# Eval( "Delay" ) + " روز" %>'></asp:Label>
                            </ItemTemplate>
                        </asp:TemplateField>
                        <asp:TemplateField>
                            <ItemTemplate>
                                <asp:Button ID="ButtonSeeMore" runat="server" CommandArgument='<%# Eval( "ContractId" ) %>'
                                    CommandName="ContractId" OnClick="ButtonSeeMore_Click" Text="مشاهده" />
                            </ItemTemplate>
                        </asp:TemplateField>
                    </Columns>
                    <HeaderStyle BackColor="#688CF5" ForeColor="#000066" />
                    <PagerStyle BackColor="#688CF5" />
                    <PagerTemplate>
                        <div class="append-11 footer">
                            <asp:UpdatePanel ID="UpdatePanelFooter" runat="server">
                                <ContentTemplate>
                                    <table cellpadding="3px" cellspacing="5px">
                                        <tr>
                                            <td>
                                                <asp:LinkButton ID="LinkButtonLast" runat="server" OnClick="LinkButtonLast_Click">آخرین</asp:LinkButton>
                                            </td>
                                            <td>
                                                <asp:LinkButton ID="LinkButtonNext" runat="server" OnClick="LinkButtonNext_Click">بعدی</asp:LinkButton>
                                            </td>
                                            <td>
                                                <asp:LinkButton ID="LinkButtonPrevious" runat="server" OnClick="LinkButtonPrevious_Click">قبلی</asp:LinkButton>
                                            </td>
                                            <td>
                                                <asp:LinkButton ID="LinkButtonFirst" runat="server" OnClick="LinkButtonFirst_Click">اولین</asp:LinkButton>
                                            </td>
                                        </tr>
                                    </table>
                                    <br />
                                    <asp:Label ID="LabelPageNumber" runat="server" Text="Label"></asp:Label>
                                </ContentTemplate>
                            </asp:UpdatePanel>
                        </div>
                    </PagerTemplate>
                </asp:GridView>
            </div>
              
              </ContentTemplate>
              </uc1:Holder1>
              </ContentTemplate>
        </asp:RoleGroup>
        </RoleGroups>
        </asp:LoginView>

    </ContentTemplate>
    </asp:UpdatePanel>
</asp:Content>
